#include "KSADAnalyzeMessenger.hh"
#include "KSADAnalyze.hh"
#include "G4UIdirectory.hh"
#include "G4UIcmdWithoutParameter.hh"
#include "G4UIcommand.hh"

KSADAnalyzeMessenger::KSADAnalyzeMessenger(KSADAnalyze* newAnalyze)
{
	analyze = newAnalyze;

	mainDirectory = new G4UIdirectory("/analyze/");
	mainDirectory->SetGuidance("Contains commands for KSAD data analysis.");

	analyzeCmd = new G4UIcmdWithoutParameter("/analyze/analyze",this);
	analyzeCmd->SetGuidance("Analyze data.root file in filePath directory.");

	analyzeVisCmd = new G4UIcmdWithoutParameter("/analyze/analyzeVis",this);
	analyzeVisCmd->SetGuidance("Open visualization for analysis.");
}

KSADAnalyzeMessenger::~KSADAnalyzeMessenger()
{
	delete mainDirectory;
	delete analyzeCmd;
	delete analyzeVisCmd;
}

void KSADAnalyzeMessenger::SetNewValue(G4UIcommand* command,G4String)
{
	if(command == analyzeCmd)
	{
		analyze->Analyze();
	}
	else if(command == analyzeVisCmd)
	{
		analyze->Visualize();
	}
}

G4String KSADAnalyzeMessenger::GetCurrentValue(G4UIcommand*)
{
	return "";
}
